package com.demo.api;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @ClassName: ResponseResult
 * @Description: ResponseResult
 * @Author: zzz
 * @Date: 2020-04-04 21:52
 */
@Data
@ApiModel(value = "返回模板")
public class ResponseResult<T> {
    @ApiModelProperty(value = "状态码")
    private Integer code;
    @ApiModelProperty(value = "状态信息")
    private String msg;
    @ApiModelProperty(value = "业务数据")
    private T data;

    public ResponseResult() {
    }

    public ResponseResult(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
        this.data = null;
    }

    public ResponseResult(Integer code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
}
